package logic

import (
	"context"
	"jdmall_svc/models/mysql"

	"jdmall_svc/internal/svc"
	"jdmall_svc/jdmall"

	"github.com/zeromicro/go-zero/core/logx"
)

type ShopDelLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewShopDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShopDelLogic {
	return &ShopDelLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 删除
func (l *ShopDelLogic) ShopDel(in *jdmall.ShopDelRequest) (*jdmall.ShopDelResponse, error) {
	// todo: add your logic here and delete this line

	mysql.DB.Debug().Where("id = ?", in.Id).Delete(&mysql.Shop{})

	return &jdmall.ShopDelResponse{}, nil
}
